#include<string.h>
#include<stdio.h>
#include<stdlib.h>

struct stringList {
	char **strings;
	//char
};

stringList **explode(char *str, char *del){

	char *nextpiece;
	char **output;
	int i,delc = 0;
	stringlist o;


	while (i<strlen(str)) {
		if (*(str+i) == *del) delc++;
		i++;
	}
	printf("Pocet d %d",delc);
	i=0;

	output = (char**)malloc(delc*sizeof(char));
	
	nextpiece = strtok(str, del);
	i=0;
	*(output+i)=nextpiece;
	printf("%d: \"%s\"\n", i, *(output+i));
	i++;
	while (nextpiece !=NULL) {
		nextpiece = strtok(NULL, del);
		strcpy(*(output+i),nextpiece);
		printf("%d: \"%s\"\n", i, *(output+i));
		i++;
	}

	
	
}

int main()
{
	char **vysledok;
	char *s1 = "aaa.nnn.ooo";
	char *s2 = ".";
	vysledok = explode(s1,s2);
	
	return 0;
}
